using UnityEngine;
using System.Collections;

public class Game : MonoBehaviour 
{
	
	private static Game instance = null;
	private ArrayList unitsPool = null;
	private ArrayList alliedUnitsPool = null;
	
    public static Game Instance 
	{ 
        get 
		{
            if (instance == null)
            {
                GameObject go = new GameObject();
                instance = go.AddComponent<Game>();
                go.name = "Game";
				DontDestroyOnLoad(go);
				instance.Start();
            }

            return instance; 
        } 
    }
	
	public void Clear()
	{
		unitsPool.Clear();
		alliedUnitsPool.Clear();
	}
	
	public void AddUnit(Unit unit)
	{
		unitsPool.Add(unit);
	}
	
	public void AddAlliedUnit(Unit unit)
	{
		alliedUnitsPool.Add(unit);
	}
	
	public ArrayList getUnits()
	{
		return unitsPool;
	}
	
	public ArrayList getAlliedUnits()
	{
		return alliedUnitsPool;
	}
	
	void Start () 
	{

	}
	
	void Update () 
	{
	
	}
	
	void Awake()
	{
		unitsPool = new ArrayList();
		alliedUnitsPool = new ArrayList();
	}
}
